cmake_minimum_required(VERSION 3.16)

project(CNC_Saw VERSION 0.1 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt6 REQUIRED COMPONENTS Quick SerialPort SerialBus)

qt_standard_project_setup(REQUIRES 6.5)

set(CMAKE_AUTORCC on)

qt_add_executable(appCNC_Saw
    main.cpp
)

qt_add_qml_module(appCNC_Saw
    URI CNC_Saw
    VERSION 1.0
    QML_FILES
        Main.qml
        QML_FILES A_InputWindow.qml
        QML_FILES A_Button.qml
        QML_FILES ManualProcess_Window.qml
        RESOURCES
        QML_FILES BottomBar.qml
        QML_FILES TopAreaBar.qml
        RESOURCES Images.qrc
        QML_FILES A_IconButton.qml
        QML_FILES ExtraLongProcess_Window.qml
        QML_FILES ExtraShortProcess_Window.qml
        QML_FILES OrderProcess_Window.qml
        QML_FILES CornerProcess_Window.qml
        QML_FILES Debug_Window.qml
        QML_FILES Parameter_Window.qml
        QML_FILES A_ShowWindow.qml

)

# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
# If you are developing for iOS or macOS you should consider setting an
# explicit, fixed bundle identifier manually though.
set_target_properties(appCNC_Saw PROPERTIES
#    MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appCNC_Saw
    MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
    MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
    MACOSX_BUNDLE TRUE
    WIN32_EXECUTABLE TRUE
)

target_link_libraries(appCNC_Saw
    PRIVATE Qt6::Quick
    PRIVATE Qt6::SerialPort
    PRIVATE Qt6::SerialBus
)

include(GNUInstallDirs)
install(TARGETS appCNC_Saw
    BUNDLE DESTINATION .
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
